package org.jetlinks.pro.koudai.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.hswebframework.ezorm.rdb.mapping.annotation.DefaultValue;
import org.hswebframework.web.api.crud.entity.GenericEntity;
import org.hswebframework.web.crud.generator.Generators;
import org.hswebframework.web.validator.CreateGroup;

import javax.persistence.Column;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 实验项目信息
 *
 * @author zhoukun
 * @since 1.3
 */
@Getter
@Setter
@Table(name = "k_experiment", indexes = {
    @Index(name = "idx_experiment_id", columnList = "id")
})
public class ExperimentEntity extends GenericEntity<String> {
    //课程名称	实验名称	版本号	创建学校	创建教师	pdf讲义	word讲义	excel表格	仿真模型	教学视频
    @Column(length = 64, nullable = false)
    @NotBlank(message = "[key]不能为空", groups = CreateGroup.class)
    @Schema(description = "实验名称")
    private String experimentName;

    @Column(length = 64)
    @Schema(description = "所属课程id")
    private String courseId;

    @Column(length = 64)
    @Schema(description = "创建学校")
    private String createSchoolBy;

    @Column(length = 64)
    @Schema(description = "创建教师")
    private String createTeacherBy;

    @Column(length = 64)
    @Schema(description = "pdf讲义")
    private String pdfTutorial;
    @Column(length = 64)
    @Schema(description = "word讲义")
    private String wordTutorial;
    @Column(length = 64)
    @Schema(description = "excel表格")
    private String excelSheet;
    @Column(length = 64)
    @Schema(description = "仿真模型")
    private String simulationModel;

    @Schema(description = "教学视频")
    private List<String> videoTutorials = new ArrayList<>();
    @Column(length = 32)
    @Schema(description = "实验项目版本")
    private String version;

    @Column(updatable = false)
    @DefaultValue(generator = Generators.CURRENT_TIME)
    private Date createTime;

    @Column
    @DefaultValue(generator = Generators.CURRENT_TIME)
    private Date updateTime;


}
